<?php
/**
 * Project     Newsletter for Joomla 1.5.x
 * Release     2.0.2
 * @package    Communicator
 * @subpackage Component
 * @version    $Id$ - version.communicator.php
 * @link       http://joomlacode.org/gf/project/communicator/
 * @copyright  Copyright (c) 2008-2009 Erik Damke - All rights reserved
 * @license    http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php for details
 *
 * @Author     Erik Damke (commqc20@jocoflex.com)
 */

// Ensure this file is included via Joomla Framework
defined('_JEXEC') or die('Restricted access');

/**
 * Version information
 *
 * @package   Communicator for Joomla 1.5.x
 * @since   2.0
 */
class CM_comVersion
{
   /** @var string Product */
   var $PRODUCT    = 'Communicator';

   /** @var int Main Release Level */
   var $RELEASE    = '2.0';

   /** @var string Development Status */
   var $DEV_STATUS = 'Production/Stable';
   //var $DEV_STATUS = 'Release Candidate';

   /** @var int Sub Release Level */
   var $DEV_LEVEL    = '2';

   /** @var int build Number */
   var $BUILD       = '';
   /** @var string Codename */
    var $CODENAME  = 'Eagle';

   /** @var string Date */
   var $RELDATE    = '21-July-2009';
   /** @var string Time */
   var $RELTIME    = '18:00';
   /** @var string Timezone */
   var $RELTZ      = 'GMT';

   /** @var string Copyright Text */
   var $COPYRIGHT    = 'Copyright (c) 2008 Stefan Granholm, Copyright 2009 Erik Damke - All rights reserved.';

   /** @var string HOME */
   var $HOME       = 'http://joomlacode.org/gf/project/communicator';

   /** @var string LOGOFILE */
   var $LOGOFILE   = '/administrator/components/com_communicator/assets/communicator.png';

   /**
    *
    * @return string Long format version
    */
   function getLongVersion()
   {
      return $this->PRODUCT.' '.$this->getShortVersion().' '
            .$this->DEV_STATUS.' [ '.$this->CODENAME .' ] '
            .$this->RELDATE .' '.$this->RELTIME.' '.$this->RELTZ;
   }

/**
    *
    * @return string format version for Admin Footer
    */
   function getAdminVersion()
   {
      return $this->PRODUCT.' '.$this->getShortVersion().' '
            .' [ '.$this->CODENAME .' ] '
            .$this->RELDATE;
   }

   /**
    *
    * @return string version format: Product Release Dev_Level
    */
   function getProductVersion() {
      return $this->PRODUCT .' '. $this->getShortVersion();
   }

   /**
    *
    * @return string Short version format
    */
   function getShortVersion() {
      return $this->RELEASE .'.'. $this->DEV_LEVEL;
   }


   /**
    * Compares two "A PHP standardized" version number against the current Component version
    *
    * @return boolean
    * @see http://www.php.net/version_compare
    */
   function isCompatible ( $minimum ) {
      return (version_compare( $this->getShortVersion(), $minimum, 'eq' ) == 1);
   }
}